package com.lianbi.pageStatic;

import com.lianbi.util.ConfigUtil;


public class PageStaticMonitor implements Runnable {

	private static long interval = 5 * 60 * 1000 ;
	static{
		
		String timeStr = ConfigUtil.getValue("transfer.time") ;
		try{
			interval = Long.parseLong(timeStr) ;
			interval = interval * 1000 ; 
		}
		catch(Exception e){
			interval = 5 * 60 * 1000 ;
		}
	}
	
	/**
	 * @see java.util.TimerTask#run()
	 */
	public void run(){
		
		while (!Thread.interrupted()){
			TransferManager transferMgr = TransferManager.getInstance();
			transferMgr.processTasks();
			try{
				Thread.sleep(interval);
			} catch (InterruptedException e){
				e.printStackTrace() ;
				break;
			}
		}
	}

}
